/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

/**
 *
 * @author pais
 */
public class Role extends AnyObject{
    private int Id;
    private String Name;
    private String Properties;

    public int getId() {
        return Id;
    }

    public void setId(int Id) {
        this.Id = Id;
    }

    public String getName() {
        return Name;
    }

    public void setName(String Name) {
        this.Name = Name;
    }

    public String getProperties() {
        return Properties;
    }

    public void setProperties(String Properties) {
        this.Properties = Properties;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder()
                .append("Name: ").append(this.Name);
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
   //PORQUE HACIAMOS ESTA PREGUNTA??????
        if (this==obj) return true;
   //PORQUE HACIAMOS ESTA PREGUNTA??????
        if (!(obj instanceof Role)) return false;
   //CAST????     
        final Role role = (Role) obj;
   //EXPRESION INCOMPRENSIBLE
        return !(Name != null ? !Name.equals(role.getName()) : role.getName() != null);
    }

    @Override
    public int hashCode() {
        return(Name!=null ? Name.hashCode() : 0 );
    }

}
